/****************************************************************
 * <strong>MFORMappingGlobe类型转换类</strong>
 *
 * <p>
 * 类型转换类
 * </p>
 *
 * @author AndyZhang 2011 cnet2001@163.com
 * @version 0.1
 * ToDo:
 ***************************************************************/

package com.thinkwide.data.ormapping;

import com.thinkwide.data.core.MFString;

public class MFORMappingGlobe {
    private static MFDataAdapter dataAdapter = null;

    public static MFDataAdapter getDataAdapter() {
        if (dataAdapter == null) {
            Init(MFString.Empty);
        } else {
            if (dataAdapter.getTransaction().getConn() == null) {
                Init(MFString.Empty);
            }
        }
        return dataAdapter;
    }

    public static MFDataAdapter getDataAdapter(String dbName) {
        MFDataAdapter da = new MFDataAdapter(dbName);
        return da;
    }

    public static boolean Init(String providerName) {
        dataAdapter = new MFDataAdapter();
        return dataAdapter != null;
    }
}
